package com.qf.controller;


import com.qf.pojo.Student;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/student")
public class StudentController {


    @RequestMapping("/add")
    public String add(){

        System.out.println("add方法被触发");
        return "tom";

    }
    @RequestMapping("/show")
    public String show(int id){
        System.out.println(id);
        System.out.println("show方法被触发");
        return "id";
    }

    @RequestMapping("/change")
    public String change(@RequestBody Student student){
        System.out.println("username----->"+student.getUserName());
        System.out.println("age------->"+student.getAge());
        System.out.println("change方法被触发");
        return "change";
    }

}
